package com.hongguan.oms.service.supervise;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;
import com.hongguan.oms.service.BaseService;

/**
 * TrfaultMaint Service
 * 
 * @author Maping
 * 
 */
@SuppressWarnings("unchecked")
@Service
public class CustomerMaintService extends BaseService {

	public CustomerMaintService() {
		this.namespace = "T_CUSTOMER_MAINT";
	}

	public List searchMaintBy(Map param) {
		return this.getSqlMapClientTemplate().queryForList(
				this.getStatementName("searchMaintBy"), param);
	}

	public Long countMaintBy(Map param) {
		return (Long) this.getSqlMapClientTemplate().queryForObject(
				this.getStatementName("countMaintBy"), param);
	}

	// search maint
	public HashMap searchById(Map param) {
		return (HashMap) this.getSqlMapClientTemplate().queryForObject(
				this.getStatementName("searchById"), param);
	}

	public List searchCustomerInfoByMaintId(Map param) {
		return this.getSqlMapClientTemplate().queryForList(
				this.getStatementName("searchCustomerInfoByMaintId"), param);
	}
	
	public List searchCustomerDesByMaintId(Map param) {
		return this.getSqlMapClientTemplate().queryForList(
				this.getStatementName("searchCustomerDesByMaintId"), param);
	}
	public List searchCustomerFlowByMaintId(Map param) {
		return this.getSqlMapClientTemplate().queryForList(
				this.getStatementName("searchCustomerFlowByMaintId"), param);
	}	

	// add maint
	public long addMaint(Map param) {
		long id = (Long) this.getSqlMapClientTemplate().insert(
				this.getStatementName("addMaint"), param);
		return id;
	}

	public void addCustomerInfo(Map param) {
		this.getSqlMapClientTemplate().insert(
				this.getStatementName("addCustomerInfo"), param);
	}

	public void addCustomerFactor(Map param) {
		this.getSqlMapClientTemplate().insert(
				this.getStatementName("addCustomerFactor"), param);
	}
	
	public void addCustomerFlow(Map param) {
		this.getSqlMapClientTemplate().insert(
				this.getStatementName("addCustomerFlow"), param);
	}
	
	public void addCustomerDes(Map param) {
		this.getSqlMapClientTemplate().insert(
				this.getStatementName("addCustomerDes"), param);
	}
}
